package org.tinygroup.fizzbuzzwhizz;

/**
 * Created by luoguo on 2014/5/6.
 */
public abstract class AbstractNumberReader implements NumberReader {
    private int priority;
    private boolean exclusive;

    public AbstractNumberReader(int priority, boolean exclusive) {
        this.priority = priority;
        this.exclusive = exclusive;
    }

    public int getPriority() {
        return priority;
    }

    public boolean isExclusive() {
        return exclusive;
    }

    public int compareTo(NumberReader numberReader) {
        if (priority > numberReader.getPriority()) {
            return -1;
        }
        if (priority < numberReader.getPriority()) {
            return 1;
        }
        return 0;
    }
}
